

<div id="content">
    <div id="deal-buy" class="box">
        <div class="box-top"></div>
        <div class="box-content">
            <div class="head"><h2>您的订单</h2></div>
            <div class="sect">
				<div class="paytype">
<?php
$this->breadcrumbs=array(
	'Orders'=>array('index'),
	$model['order']->id,
);

$this->menu=array(
//	array('label'=>'List Order', 'url'=>array('index')),
//	array('label'=>'Create Order', 'url'=>array('create')),
//	array('label'=>'Update Order', 'url'=>array('update','id'=>$model['order']->id)),
//	array('label'=>'Delete Order', 'url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model['order']->id),'confirm'=>'Are you sure you want to delete this item?')),
//	array('label'=>'Manage Order', 'url'=>array('admin')),
);
?>
<div class="row buttons">
		<?php echo CHtml::link('» 返回修改订单',array('order/update','id'=>$model['order']->id)); ?>
</div>
<h1><?php //echo $model['order']->team_id;echo '<br>' ;
			echo '项目名称:';echo $model['title']; ?><br/></h1>


<div><?php echo  "账户余额：".$model['usermoney']."元"; ?></div>
	<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model['order'],
	//'data'=>$model,

	'attributes'=>array(

		'quantity',
		'price',
		'fare',
		'origin',
		'realname',
		'mobile',
		'zipcode',
		'address',
		'express',
		'remark',
	),
));


?>
<div class="row buttons">
<?php $num=$model['order']->quantity;
	  $max=$model['max_number'];
	  $now=$model['now_number'];
	  $left=$max-$now;
	  if($left>=$num) { echo CHtml::link('确认订单，付款',array('order/pay','id'=>$model['order']->id));echo " <br/>";
	  if($model['order']->money>0) echo CHtml::link('确认订单，以后再付款',array('order/indexview','id'=>$model['order']->id));
 					  }
      else if($left!=0)
		echo "最多可购买".$left."个";
		else
		echo CHtml::link('卖光了，返回首页',array('index.php'));
		?>

</div>

			</div>
			</div>
		</div>
		<div class="box-bottom"></div>
	</div>
</div>











